package com.example.edu.Controller;

import com.example.edu.Dto.MindMapUpdateDtoG;
import com.example.edu.Dto.Return;
import com.example.edu.Entity.Course;
import com.example.edu.Entity.Document;
import com.example.edu.Service.MindMapService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/mindMap")
public class MindMapController {
    @Resource
    MindMapService mindMapService;

    @PostMapping("/refresh")
    public Return refresh(@RequestBody Document documentId){
        return mindMapService.refresh(documentId.getDocument_id());
    }

    @PostMapping("/update")
    public Return update(@RequestBody MindMapUpdateDtoG mindMapUpdateData){
        return mindMapService.update(mindMapUpdateData);
    }

    @PostMapping("/get")
    public Return get(@RequestBody Document documentId){
        return mindMapService.get(documentId.getDocument_id());
    }
}
